package com.ocom.payhandle.controller;

import com.ocom.common.constant.PayHandleUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.common.vo.pay.FaceErrVo;
import com.ocom.payhandle.service.DeviceInfoService;
import com.ocom.payhandle.service.FaceErrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/9/1
 **/
@RestController
public class FaceController {

	@Autowired
	FaceErrService faceErrService;

	@Autowired
	DeviceInfoService deviceInfoService;

	@PostMapping(PayHandleUrl.URL_faceErrRecode)
	public Result faceErrRecode(@RequestBody FaceErrVo faceErrVo){
		if(faceErrVo.getIds()!=null && faceErrVo.getIds().size()>0){
			faceErrService.Add(faceErrVo.getComId(),faceErrVo);
		}
		deviceInfoService.deviceFaceNum(faceErrVo.getComId(),faceErrVo.getDeviceNo(),faceErrVo.getLoginNum());
		return ResultUtil.success();
	}

}
